package com.myjob.enums;

/**
 * @author chenyuan
 * @date 2021/1/12 21:52
 */
public class JobEnums {
    /**
     * 教育水平
     * '初中及以下：1','高中：2','大专：3','本科：4','硕士：5','博士：6'
     */
    public enum EDUCATION_LEVEL{
        //
        middle("1", "初中及以下"),
        high("2", "高中"),
        junior("3", "大专"),
        undergraduate("4", "本科"),
        master("5", "硕士"),
        doctor("6", "博士");

        private String key;
        private String value;

        EDUCATION_LEVEL(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (EDUCATION_LEVEL c : EDUCATION_LEVEL.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }

    }

    /**
     * 当前求职信息状态
     * 已送达:1   ；  已查阅:2   ；   感兴趣:3   ；  不感兴趣:4   ；  邀面试:5
     */
    public enum HUNTING_STATUS{
        //
        arrived("1", "已送达"),
        consulted("2", "已查阅"),
        interested("3", "感兴趣"),
        uninterested("4", "不感兴趣"),
        interview("5", "邀面试");

        private String key;
        private String value;

        HUNTING_STATUS(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (HUNTING_STATUS c : HUNTING_STATUS.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

    /**
     * 工资的单位
     * '元/天：1','千/月：2','万/年：3'
     */
    public enum SALARY_UNIT{
        //
        day("1", "元/天"),
        month("2", "千/月"),
        year("3", "万/年");

        private String key;
        private String value;

        SALARY_UNIT(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (SALARY_UNIT c : SALARY_UNIT.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

    /**
     * 工作类别
     * '全职：1','兼职：2','实习：3'
     */
    public enum JOB_TYPE{
        //
        full_time("1", "全职"),
        part_time("2", "兼职"),
        internship("3", "实习");

        private String key;
        private String value;

        JOB_TYPE(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (JOB_TYPE c : JOB_TYPE.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

    /**
     * 工作经验
     * 实习生/应届生:1  ;  < 1年:2  ;  1-3年:3  ;  3-5年:4  ;  > 5年:5
     */
    public enum EXPERIENCE{
        // 实习生 或 应届生
        level_1("1", "实习生/应届生"),
        less_one("2", "< 1年"),
        one_to_three("3", "1-3年"),
        three_to_five("4", "3-5年"),
        more_five("5", "> 5年");

        private String key;
        private String value;

        EXPERIENCE(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (EXPERIENCE c : EXPERIENCE.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

    /**
     * 工作招聘状态
     * 正常：1  ；暂停：2  ；停止：3
     */
    public enum JOB_STATUS{
        //
        normal("1", "正常"),
        suspend("2", "暂停"),
        stop("3", "停止");

        private String key;
        private String value;

        JOB_STATUS(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (JOB_STATUS c : JOB_STATUS.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

}
